﻿using WsSample;
using System;

namespace WsSample
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("程序启动 ->" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));

            // 启动 客户端
            WsClientSample client = WsClientSample.Instance;

            // 启动 服务端
            WsServerSample server = WsServerSample.Instance;

            #region 输入指令响应动作
            // 循环打印输入命令
            bool isExit = true;
            while (isExit)
            {
                string? content = Console.ReadLine();

                switch (content)
                {
                    case "0":
                        {
                            Console.WriteLine("程序退出 ->" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                            isExit = false;
                            Environment.Exit(0);
                            break;
                        }
                    case "1":
                        {
                            string dsc = "0 ： 退出程序；\r\n 1 ： 打印指令描述； \r\n 2 ： 清屏";
                            Console.WriteLine(dsc);
                            break;
                        }
                    case "2": // 清屏
                        {
                            Console.Clear();
                            break;
                        }

                    default:
                        {
                            break;
                        }

                }
            }
            #endregion
      
        }
    }
}